import React, { Component } from 'react';
import Tabbar from "./tabbar"
// 引入四个页面的组件
import Home from "./components/home/Home"
import Info from "./components/info/Info"
import My from "./components/my/My"
import Search from "./components/search/Search"
// 引入 路由的模块 Router 和 Route 路由规则
import {HashRouter as Router,Route} from "react-router-dom"
class App extends Component {
  render() {
    return (
      <Router>
        <Route path="/" exact render={(props)=><Tabbar tab="home" {...props}><Home {...props}></Home></Tabbar>}></Route>
        <Route path="/search" exact render={(props)=><Tabbar tab="search" {...props}><Search {...props}></Search></Tabbar>}></Route>
        <Route path="/info" exact render={(props)=><Tabbar tab="info" {...props}><Info {...props}></Info></Tabbar>}></Route>
        <Route path="/my" exact render={(props)=><Tabbar tab="my" {...props}><My {...props}></My></Tabbar>}></Route>
      </Router>
    );
  }
}

export default App;

